<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <include file="./Public/Tpl/head.html" title="天气预报(未来3天)" description="根据城市获取未来3日的天气情况" keywords="天气预报,API"/>
</head>
<body>
<include file="./Public/Tpl/nav.html"/>
<div class="container">
  <h3>天气预报API</h3>
  <div class="row">
    <form method="get" action="">
      <div class="col-md-5">
        <div class="form-group">
          <label for="tword">城市:</label>
          <input name="city" id="tword" class="form-control" type="text" placeholder="需要查询的目标城市"/><br>
        </div>
        <button type="submit" class="btn btn-default">提交</button>
      </div>
    </form>
    <div class="col-md-offset-0 col-md-2"></div>
    <div class="col-md-5">
      <div class="panel panel-default">
        <div class="panel-heading">查询结果:{$tips}</div>
        <div class="panel-body">
          {$result}
        </div>
      </div>
    </div>
  </div>
  <hr>
  <div class="row">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title">功能介绍</h3>
      </div>
      <div class="panel-body">
        <ol>
          <li>提交指定的城市名称,返回该城市未来3天天气信息 Json格式</li>
          <li>如果城市不存在,则返回'找不到!'</li>
          <li>API调用方式:<span>
            <php>echo "http://".I('server.SERVER_NAME').explode('?',I('server.REQUEST_URI'))[0];</php>?qq=你的QQ号&city=城市</span>
            <small>(示例见提交后的url)</small>
          </li>
        </ol>
      </div>
    </div>
  </div>
</div>
<include file="./Public/Tpl/footer.html"/>
</body>
</html>